package drp.snowbell.entity;

import java.util.Collection;

import drp.snowbell.part.IPart;


/**
 * 代理实体,用于处理关联
 * 
 * @author wuhj
 * 
 */
public class RelationEntity implements IEntity {
	private IEntity entity;

	public RelationEntity(IEntity main, String relationName) {

	}

	@Override
	public String getName() {
		return getEntity().getName();
	}

	@Override
	public void setName(String name) {
		getEntity().setName(name);
	}

	@Override
	public Object getValue(Property property) {
		return getEntity().getValue(property);
	}

	@Override
	public void setValue(Property property, Object value) {
		getEntity().setValue(property, value);
	}

	@Override
	public String getId() {
		return getEntity().getId();
	}

	@Override
	public void setId(String Id) {
		getEntity().setId(Id);
	}

	@Override
	public Boolean getDeleted() {
		return getEntity().getDeleted();
	}

	@Override
	public void setDeleted(Boolean deleted) {
		getEntity().setDeleted(deleted);
	}

	@Override
	public IEntity cloneEntity() {
		return getEntity().cloneEntity();
	}

	@Override
	public String getEntityName() {
		return getEntity().getEntityName();
	}

	@Override
	public Integer getStorageVersion() {
		return getEntity().getStorageVersion();
	}

	@Override
	public void setStorageVersion(Integer nVersion) {
		getEntity().setStorageVersion(nVersion);
	}

	@Override
	public IPart getPart(String partName) {
		return getEntity().getPart(partName);
	}

	@Override
	public Collection<IPart> getPartList() {
		return getEntity().getPartList();
	}

	@Override
	public Object getBasicValue(Property property) {
		return getEntity().getBasicValue(property);
	}

	@Override
	public void setBasicValue(Property property, Object value) {
		getEntity().setBasicValue(property, value);
	}

	private IEntity getEntity() {
		if (entity == null) {
			// TODO load
		}
		return entity;
	}

}
